﻿Public Class OutSite
    Inherits System.Web.UI.MasterPage

    Public objConfig As New Configs
    Public currUrl As String = String.Empty

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Try
            shortcut.NavigateUrl = objConfig.Shortcut.ToString
            shortcut.Attributes.Add("title", objConfig.ShortcutTitle.ToString)
        Catch ex As Exception

        End Try

        currUrl = HttpContext.Current.Request.Url.AbsoluteUri

        If Not Page.IsPostBack Then
            Dim numCart As Integer = 0
            Try
                ' Khai bao table cart
                Dim objDT As System.Data.DataTable
                ' Lay table tu session
                objDT = Session("Cart")
                numCart = objDT.Rows.Count
            Catch ex As Exception

            End Try
            ' Neu so luong phan tu ma k lon hon 0 thi tao moi
            If Not numCart > 0 Then
                ' Khoi tao bien Gio Hang
                Dim obj As New Cart
                ' kiem tra neu bang khong co du lieu thi moi tao 1 cai moi'
                obj.makeCart()
            End If
        End If
    End Sub

End Class